﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZHDJ.Data.Models.Edu;
using ZHDJ.WebPage;

namespace ZHDJ.Web.Portal
{
    public partial class VideoOnline : System.Web.UI.Page
    {
        public string FileID
        {
            get
            {
                return this.Request["id"]??"";
            }
        }
        public string Module
        {
            get
            {
                return this.Request["Module"]??"";
            }
        }
        public string ModuleID
        {
            get
            { 
                return this.Request["ModuleID"]??"";
            }
        }
        /// <summary>
        /// 视频url
        /// </summary>
        public string FileUrl { get; set; }

        /// <summary>
        /// IsMp4
        /// </summary>
        public string IsMp4 { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            FileUrl = UpFileBusiness.GetFileUrl(FileID);
            IsMp4=FileUrl.ToLower().EndsWith(".mp4")?"1":"0";
            InitNavigation();
        }

        private void InitNavigation()
        {
            switch (Module)
            {
                case "EduCourseware":
                    this.naEduCourseware.Visible = true;
                    var dt = PartyEduCourseware.GetSingle(ModuleID);
                    foreach (DataRow dr in dt.Rows)
                    {
                        this.lblTitle.Text = Convert.ToString(dr["Title"]);
                    }
                    break;
            }
        }
    }
}